import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import { MessageBox } from 'element-ui'
import axios from 'axios'

import NavBar from './components/common/NavBar.vue';
import Sidebar from './components/common/Sidebar.vue'
import TemperatureControl  from './components/common/TemperatureControl.vue'
import positioning from './components/common/positioning.vue'

Vue.component('NavBar', NavBar);
Vue.component('Sidebar', Sidebar);
Vue.component('TemperatureControl',TemperatureControl)
Vue.component('positioning',positioning)

// import TimelineSliderVue from 'timeline-slider-vue'
// import 'timeline-slider-vue/lib/timeline-slider-vue.css'
// Vue.use(TimelineSliderVue)
import './style/index.less'
import VueWebSocket from 'vue-websocket'
//重置css
import 'normalize.css/normalize.css'
import Cookies from 'js-cookie'
 import './permission'

var THREE = window.THREE

Vue.prototype.THREE = THREE

Vue.config.productionTip = false
Vue.prototype.$axios = axios
axios.defaults.baseURL = '/api' //关键代码
Vue.config.productionTip = false

// 引入Echarts
// import wxjs from  './util/jweixin-1.2.0'

// import './permission'

//使用本地字体文件
import 'vant/lib/icon/local.css'
import './assets/font/iconfont.css'
/* 风例子 */
import 'leaflet/dist/leaflet.css'
import L from 'leaflet'
import 'leaflet-velocity'
import 'amfe-flexible'

import Crypto from './util/encryp.js'
Vue.prototype.$crypto = Crypto

// import Vconsole from 'vconsole'
// let vConsole = new Vconsole()

//引入echarts

import echarts from '@/components/echarts/echarts.js'
// 挂载到vue实例中
Vue.prototype.$echarts = echarts

//引入中央事件总线





//引入自定义指令
import * as directives from './directives/index.js'
Object.keys(directives).forEach((k) => Vue.directive(k, directives[k]))

//引入自定义过滤器
import * as filters from './filter/index.js'
Object.keys(filters).forEach((key) => {
  Vue.filter(key, filters[key])
})

///引入公有方法
import * as methods from './util/index.js'
Object.keys(methods).forEach((k) => {
  Vue.prototype[k] = methods[k]
})

//引入全局通用组件
import myComponents from './components/overall/index.js'
Object.keys(myComponents).forEach((k) => Vue.component(k, myComponents[k]))

//

//引入vant
import {
  Button,
  Toast,
  Grid,
  GridItem,
  Icon,

  Tabbar,
  TabbarItem,

  SidebarItem,
  Tab,
  Tabs,
  Popup,
  Col,
  Row,
  Checkbox,
  CheckboxGroup,
  RadioGroup,
  Radio,
  Uploader,
  Cell,
  Area,
  Picker,
  Circle,
  DatetimePicker,
  Divider,
  ActionSheet,
  Field,
  CellGroup,

} from 'vant'
// Vue.use(wxjs);
// Vue.use(vConsole)
Vue.use(Button)

Vue.use(Toast)
Vue.use(Grid)
Vue.use(GridItem)
Vue.use(Icon)
Vue.use(Cookies)

Vue.use(Tabbar)
Vue.use(TabbarItem)

Vue.use(SidebarItem)
Vue.use(Tab)
Vue.use(Tabs)
// Vue.use(VueWebSocket)
Vue.use(Popup)
Vue.use(Checkbox)
Vue.use(CheckboxGroup)
Vue.use(Radio)
Vue.use(RadioGroup)
Vue.use(Uploader)
Vue.use(Area)
Vue.use(Picker)
Vue.use(Circle)
Vue.use(DatetimePicker)
Vue.use(Divider)
Vue.use(ActionSheet)
Vue.use(Col)
Vue.use(Row)
Vue.use(Cell)
Vue.use(Field)
Vue.use(CellGroup)
// 引入vconsole
// import VConsole from 'vconsole';
// new VConsole();

Vue.config.productionTip = false
Vue.prototype.$confirm = MessageBox.confirm
new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount('#app')
